package com.ruoyi.yipaiju.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yipaiju.mapper.FavoriteMapper;
import com.ruoyi.yipaiju.domain.Favorite;
import com.ruoyi.yipaiju.service.IFavoriteService;

/**
 * fo_favoriteService业务层处理
 * 
 * @author liuwp
 * @date 2023-03-01
 */
@Service
public class FavoriteServiceImpl implements IFavoriteService 
{
    @Autowired
    private FavoriteMapper favoriteMapper;

    /**
     * 查询fo_favorite
     * 
     * @param id fo_favorite主键
     * @return fo_favorite
     */
    @Override
    public Favorite selectFavoriteById(Long id)
    {
        return favoriteMapper.selectFavoriteById(id);
    }

    /**
     * 查询fo_favorite列表
     * 
     * @param favorite fo_favorite
     * @return fo_favorite
     */
    @Override
    public List<Favorite> selectFavoriteList(Favorite favorite)
    {
        return favoriteMapper.selectFavoriteList(favorite);
    }

    /**
     * 根据业务主键查询一条记录：fo_favorite
     *
     * @param favorite fo_favorite
     * @return fo_favorite
     */
    @Override
    public Favorite selectOneFavorite(Favorite favorite)
    {
        return favoriteMapper.selectOneFavorite(favorite);
    }

    /**
     * 新增fo_favorite
     * 
     * @param favorite fo_favorite
     * @return 结果
     */
    @Override
    public int insertFavorite(Favorite favorite)
    {
        favorite.setCreateTime(DateUtils.getNowDate());
        return favoriteMapper.insertFavorite(favorite);
    }

    /**
     * 修改fo_favorite
     * 
     * @param favorite fo_favorite
     * @return 结果
     */
    @Override
    public int updateFavorite(Favorite favorite)
    {
        return favoriteMapper.updateFavorite(favorite);
    }

    @Override
    public int updateFavoriteCondition(Favorite favorite, Favorite favoriteCondition)
    {
        return favoriteMapper.updateFavoriteCondition(favorite, favoriteCondition);
    }

    /**
     * 批量删除fo_favorite
     * 
     * @param ids 需要删除的fo_favorite主键
     * @return 结果
     */
    @Override
    public int deleteFavoriteByIds(Long[] ids)
    {
        return favoriteMapper.deleteFavoriteByIds(ids);
    }

    /**
     * 删除fo_favorite信息
     * 
     * @param id fo_favorite主键
     * @return 结果
     */
    @Override
    public int deleteFavoriteById(Long id)
    {
        return favoriteMapper.deleteFavoriteById(id);
    }

    /**
     * 条件删除fo_favorite
     *
     * @param favorite fo_favorite
     * @return 结果
     */
    @Override
    public int deleteFavoriteByCondition(Favorite favorite)
    {
        return favoriteMapper.deleteFavoriteByCondition(favorite);
    }

    @Override
    public List<Favorite> selectFavoritesHouseInfo(Favorite favorite) {
        return favoriteMapper.selectFavoritesHouseInfo(favorite);
    }

}
